package com.googlecode.iiddefecttracker.service;

import java.util.List;

import com.googlecode.iiddefecttracker.dao.DefectDao;
import com.googlecode.iiddefecttracker.domain.Defect;
import com.googlecode.iiddefecttracker.domain.EntityNotFound;

/**
 * default implementation of {@link DefectService}.
 */
public class DefectServiceImpl implements DefectService {
    
    private final DefectDao defectDao;
    
    public DefectServiceImpl(final DefectDao defectDao) {
        this.defectDao = defectDao;
    }
    
    public List<Defect> findAllDefects() {
        return defectDao.findAllDefects();
    }
    
    public Defect findDefectById(final Long defectId) throws EntityNotFound {
        return defectDao.findDefectById(defectId);
    }
    
    public void saveDefect(final Defect defect) {
        defectDao.saveDefect(defect);
        
    }
}
